from django.conf.urls import url

from request_response import views

urlpatterns = [
    # 演示匹配逻辑
    # 利用正则组提url取位置参数
    # url(r"^weather/[a-z]+/\d{4}/$",views.weather),
    # # 利用正则组提url取关键字参数
    # url(r"^weather/(?P<city>[a-z]+)/(?P<year>\d{4})/$",views.weather2),
    # url(r'query_str/$',views.query_str),
    # url(r'body_form/$',views.body_form),
    # 演示提取请求中的表单数据
    url(r'^body_json/$', views.body_json),
    # 演示获取请求头信息
    url(r'^request_head/$', views.request_head),
    # 演示响应常规操作
    url(r'^request_demo/$', views.request_demo),
    # 演示响应json
    url(r'^request_json/$', views.request_json),
    # 演示命名空间和反向解析,name参数表示给路由起个别名
    url(r'^reverse_demo/$', views.reverse_demo, name="reverse_demo"),
    #演示重定向
    url(r'^redirect_demo/$', views.redirect_demo),
    # cookie缓存数据提取
    url(r'^cookie_demo/$', views.cookie_demo),
    #演示session读写
    url(r'^session_demo/$', views.session_demo),
]


